//
//  XMAdvertisementCell.m
//  XMKit
//
//  Created by Ce Liu on 2018/5/29.
//  Copyright © 2018年 ChenXiaoMing. All rights reserved.
//

#import "XMAdvertisementCell.h"

@implementation XMAdvertisementCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self.contentView addSubview:self.advertisementImageView];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.advertisementImageView.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);
}

- (UIImageView *)advertisementImageView {
    if (!_advertisementImageView) {
        _advertisementImageView = [[UIImageView alloc] init];
        _advertisementImageView.backgroundColor = [UIColor whiteColor];
        _advertisementImageView.contentMode = UIViewContentModeScaleAspectFill;
        _advertisementImageView.clipsToBounds = YES;
    }
    return _advertisementImageView;
}

@end
